home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_09_04 / 9n04039b < prev    next >
Text File  |  1991-02-04  |  516b  |  24 lines

  1.  
  2. EVENT_MSG event; /* allocate space for an event message 
  3. */
  4. draw_screen(); /* put up your window */
  5. for(;;)
  6.     {
  7.     /* receive the message from QNX Windows */
  8.     GetEvent(0, &event, sizeof(EVENT_MSG));
  9.  
  10.     /* extract the message type, and act appropriately */
  11.     switch(Event(&event))
  12.         {
  13.         case CLICK: /* somebody clicked the mouse */
  14.             do_something();
  15.             continue;
  16.  
  17.         case QUIT: /* the user wants to quit */
  18.         case TERMINATED: /* the server is being shut down */
  19.             shutdown();
  20.             exit(0); 
  21.         }
  22.     }
  23.  
  24.